#ifndef SKLINE_H
#define SKLINE_H

#include <QGraphicsItem>
#include "skidable.h"

class SkPoint;

class SkLine : public QGraphicsItem, public SkIdAble
{
public:
    SkLine(int const& id, SkPoint *p1, SkPoint *p2,QGraphicsItem * parent=0);


    static QPointF rotate(qreal angle,const QPointF& p);
    SkPoint *sourcePoint() const;
    void setSourcePoint(SkPoint *p1);

    SkPoint *destPoint() const;
    void setDestPoint(SkPoint *p2);

    void adjust();

    enum { Type = UserType + 2 };
    int type() const { return Type; }
    QPainterPath shape() const;
protected:
    QRectF boundingRect() const;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);

    QPointF sourcePn;
    QPointF destPn;
    SkPoint *source, *dest;


};

#endif // SKLINE_H
